{template header}
<div class="bs-docs-example" style="clear:both;">
    <table class="table table-striped">
        <thead>
            <tr>
                <th width="50">状态</th>
                <th width="200">时间</th>
                <th>内容</th>
                <th width="150">推送设备</th>
                <th>跳转URL</th>
                <th width="60">编辑</th>
            </tr>
        </thead>
        <tbody>
            {loop $pushData $k $v}
            <tr>
                <td>{if $v['status'] == 0} 待发送 {elseif $v['status'] == 1}发送中{else}{完成}{/if}</td>
                <td>
                    添加：{eval echo date('Y-m-d H:i:s', $v['add_time'])}<br>
                    定时：{eval echo date('Y-m-d H:i:s', $v['send_time'])}<br>
                    完成：{if $v['finish_time'] > 0}{eval echo date('Y-m-d H:i:s', $v['finish_time'])} {/if}
                </td>
                <td>
                  <p>IOS：</p>
                  <p>{$v['ios_message']}</p>
                  <p>安卓: </p>
                  <p>标题：{$v['title']}</p>
                  <p>内容：{$v['android_message']}</p>
                </td>
                <td>
                    <p>安卓数量：{$v['android_total']}</p>
                    <p>安卓-Mi数量：{$v['android_mi_total']}</p>
                    <p>iOS数量：{$v['ios_total']}</p>
                    <p>iOS-Mi数量：{$v['ios_mi_total']}</p>
                </td>
                <td>{$v['url']}</td>
                <td>
                    <a href="?c=admin&a=msgPushInfo&handletype=edit&msg_id={$v['msg_id']}">编辑</a>
                    {if !$v['status']}<a href="javascript:void(0)" class="push-del" data-id="{$v['msg_id']}">删除</a>{/if}
                </td>
            </tr>
            {/loop}
        </tbody>
    </table>
</div>
<div class="pagination">
    <ul>
        {$pageStr}
    </ul>
</div>
<script type="text/javascript">
    $(function() {
       $('.push-del').on('click', function() {
            $.post(
                    '/admin/msgPushList',
                    {'id': $(this).attr('data-id'), 'operate': 'del'},
                    function(data){
                            if (data.code == 0) {
                                    alert(data.msg); 
                                    location.reload();
                            } else {
                                    alert(data.msg);
                            }
                    },
                    'json'
            );
       }) 
    });
</script>
{template footer}
